#include <stdio.h>
#include <unistd.h>


int main()
{
  FILE* fp = fopen("log.txt", "r");
  if (NULL == fp)
  {
    perror("fopern");
    return 1;
  }
  int count = 5;
  char buffer[64];
  while (count)
  {
    fgets(buffer, sizeof(buffer), fp);
    printf("%s", buffer);
    count--;
  }

  //int count = 5;
  //while (count)
  //{
  //  fputs("hello world\n", fp);
  //  count--;
  //}
  fclose(fp);
  return 0;
}
